package com.itheima.work01;

import java.util.Iterator;
import java.util.TreeSet;

public class Test {
    public static void main(String[] args) {

        TreeSet<Student> stu1 = new TreeSet<>();
        Student s1 = new Student("001", "zs");
        Student s2 = new Student("002", "ls");
        Student s3 = new Student("003", "ww");
        Student s4 = new Student("004", "xl");
        Student s5 = new Student("005", "zs");
        stu1.add(s1);
        stu1.add(s2);
        stu1.add(s3);
        stu1.add(s4);
        stu1.add(s5);

        TreeSet<Student> stu2 = new TreeSet<>();
        Student st1 = new Student("001", "zs");
        Student st2 = new Student("002", "ls");
        Student st3 = new Student("003", "ww");
        Student st4 = new Student("003", "al");
        Student st5 = new Student("005", "zs");
        stu2.add(st1);
        stu2.add(st2);
        stu2.add(st3);
        stu2.add(st4);
        stu2.add(st5);

        TreeSet<Teacher> teachers = new TreeSet<>();
        Teacher tea1 = new Teacher("01","教师01",stu1);
        Teacher tea2 = new Teacher("02","教师02",stu2);
        teachers.add(tea1);
        teachers.add(tea2);

        Iterator<Teacher> iterator = teachers.iterator();
        while (iterator.hasNext()){
            Teacher next = iterator.next();
            System.out.println(next);
        }
    }
}
